import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '设备编号',
    align: "center",
    dataIndex: 'deviceCode'
  },
  {
    title: '设备名称',
    align: "center",
    dataIndex: 'weibao'
  },
  {
    title: '设备开启时间',
    align: "center",
    dataIndex: 'startTime'
  },
  {
    title: '设备关闭时间',
    align: "center",
    dataIndex: 'endTime'
  },
  {
    title: '设备运行时长(分)',
    align: "center",
    dataIndex: 'duration'
  },
  {
    title: '设备维保时长',
    align: "center",
    dataIndex: 'descibles'
  },
  {
    title: '创建日期',
    align: "center",
    dataIndex: 'createTime'
  },
  {
    title: '更新日期',
    align: "center",
    dataIndex: 'updateTime'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "设备编号",
    field: 'deviceCode',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '设备编号',
    field: 'deviceCode',
    component: 'Input',
  },
  {
    label: '设备开启时间',
    field: 'startTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '设备关闭时间',
    field: 'endTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '设备运行时长',
    field: 'duration',
    component: 'InputNumber',
  },
  {
    label: '描述',
    field: 'descibles',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
